package com.mr.dao.entity.customer;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

import com.mr.constants.Tables;
import com.mr.dao.entity.BaseEntity;
import com.mr.dao.entity.admin.User;

@Entity(name = Tables.ORDER)
public class Order extends BaseEntity {
	private static final long serialVersionUID = 2170447272046544884L;
	private BigDecimal amount;
	private Calendar date_created;
	private String confirmation_number;
	private boolean order_shipped;
	private String shipping_no;
	@ManyToOne
	private User admin_user;
	@ManyToOne
	private Customer customer_account;
	@OneToMany(mappedBy = "customer_order", cascade = CascadeType.ALL)
	private List<OrderedSubproduct> orderedSubproducts = new ArrayList<OrderedSubproduct>(0);

	public BigDecimal getAmount() {
		return amount;
	}

	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}

	public Calendar getDate_created() {
		return date_created;
	}

	public void setDate_created(Calendar date_created) {
		this.date_created = date_created;
	}

	public String getConfirmation_number() {
		return confirmation_number;
	}

	public void setConfirmation_number(String confirmation_number) {
		this.confirmation_number = confirmation_number;
	}

	public boolean isOrder_shipped() {
		return order_shipped;
	}

	public void setOrder_shipped(boolean order_shipped) {
		this.order_shipped = order_shipped;
	}

	public String getShipping_no() {
		return shipping_no;
	}

	public void setShipping_no(String shipping_no) {
		this.shipping_no = shipping_no;
	}

	public Customer getCustomer_account() {
		return customer_account;
	}

	public void setCustomer_account(Customer customer_account) {
		this.customer_account = customer_account;
	}

	public User getAdmin_user() {
		return admin_user;
	}

	public void setAdmin_user(User admin_user) {
		this.admin_user = admin_user;
	}

	public List<OrderedSubproduct> getOrderedSubproducts() {
		return orderedSubproducts;
	}

	public void setOrderedSubproducts(List<OrderedSubproduct> orderedSubproducts) {
		this.orderedSubproducts = orderedSubproducts;
	}
}
